home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1991 September & October
/
rerun-1991-09-10.d64
/
elapsed time
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
166 lines
5 sd=54272:fori=sdtosd+23:pokei,0:next:pokesd+24,15:poke788,52:p$="menu runner"
10 goto115
15 poke v+21,0:print"[147]"
17 printtab(14)"[159]loading me[158]n[159]u":print"[144]load"chr$(34)p$chr$(34)",8"
20 poke198,4:poke631,13:poke632,82:poke633,213:poke634,13:end
25 print"[147]":pokev+21,0:poke53280,14:poke53281,14:sys64738
30 for w=1 to 1700:next w
35 poke 198,0
40 for c=1 to 10
45 get c$:if c$="[136]"then15
50 if c$="[140]"then25
55 if c$<>"[136]"andc$<>"[140]"andc$<>""then115
60 next
65 printtab(13)"[146]press any key[145]"
70 for d=1 to 35
75 get d$:if d$="[136]"then15
80 if d$="[140]"then25
85 if d$<>"[136]"andd$<>"[140]"andd$<>""then115
90 next
95 printtab(13)"[152]press[146] any[146] key[145]"
100 goto40
105 printtab(19)"[145] [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";:return
110 printtab(21+len(s$))"[145] [157]":s$="":return
115 gosub720:print chr$(142);chr$(8)"[147]":poke198,0:poke53280,12:poke53281,0
120 for x=1 to 2:pokev+21,0:md=0:l=0:y$="0":m$="0":d$="0":ah$="0"
125 if x=1 then printtab(7)" from:[146]"tab(13)
130 if x=2 then printtab(9)" to:[146]"tab(13)
135 print" year ?[150] ";:y$=""
136 if xx>10 then xx=0
137 if xx>5 then print" [157]";:goto 142
140 print"[164][157]";
142 get a$
145 if a$="[136]"then15
150 if a$="[140]"then25
155 if a$=chr$(19) then115
160 if a$=chr$(20) then print:gosub720:gosub105:goto135
165 if a$=chr$(13) then print:s$=y$:gosub110:goto185
170 if a$<"0" or a$>"9" then182
175 if len(y$)>3 then 182
180 print a$;:y$=y$+a$
182 xx=xx+1:goto 136
185 yy=val(y$)
190 if yy>2500 or yy<1582 then gosub105:goto135
195 printtab(13):gosub720
200 print" month?[150] ";:m$=""
202 if xx>10 then xx=0
203 if xx>5 then print" [157]";:goto 207
205 print"[164][157]";
207 get a$
210 if a$=chr$(19) then115
215 if a$=chr$(20) then print:gosub720:gosub105:goto200
220 if a$=chr$(13) then print:s$=m$:gosub110:goto240
225 if a$<"0" or a$>"9" then237
230 if len(m$)>1 then 237
235 print a$;:m$=m$+a$
237 xx=xx+1:goto 202
240 mm=val(m$)
245 ifmm<1ormm>12 then gosub105:goto200
247 if yy=1582 and mm<10 then gosub 105:goto 200
250 printtab(13):gosub720
255 print" day ?[150] ";:d$=""
257 if xx>10 then xx=0
258 if xx>5 then print" [157]";:goto 262
260 print"[164][157]";
262 get a$
265 if a$=chr$(19) then115
270 if a$=chr$(20) then print:gosub720:gosub105:goto255
275 if a$=chr$(13) then print:s$=d$:gosub110:dd=val(d$):goto305
280 if a$<"0" or a$>"9" then292
285 if len(d$)>1 then 292
290 print a$;:d$=d$+a$
292 xx=xx+1:goto 257
295 if mm=2 and dd>29 then gosub105:goto255
300 goto315
305 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))then295
310 if mm=2 and dd>28 then gosub105:goto255
315 if(mm=4 or mm=6 or mm=9 or mm=11)and dd>30 then gosub105:goto255
320 if dd<1 or dd>31 then gosub105:goto255
325 dd=dd-1
327 if yy=1582 and mm=10 and dd<14 then gosub 105:goto 255
330 printtab(13):gosub720
335 print" hour ?[150] ";:ah$="":ap$=""
337 if xx>8 then xx=0
338 if xx>4 then print" [157]";:goto 343
340 print"[164][157]";
343 get a$
345 a=val(a$)
350 if a$=chr$(19) then115
355 if a$=chr$(20) then print:gosub720:gosub105:goto335
360 if a$=chr$(13) then print:s$=ah$:gosub110:goto395
365 if a$="a" or a$="p" or a$="m" then375
370 if a$<"0" or a$>"9" then392
375 if len(ah$)>3 then 392
380 print a$;
385 if a$<>right$(str$(a),len(a$))then ap$=ap$+a$
390 ah$=ah$+a$
392 xx=xx+1:goto 337
395 ah=val(ah$)
400 if ah<1 or ah>12 then gosub105:goto335
405 aq$=right$(ah$,2)
410 if aq$<>ap$ then gosub105:goto335
415 if aq$<>"am" and aq$<>"pm" then gosub105:goto335
420 if ap$="am" and ah=12 then ah=0
425 if ap$="pm" and ah<12 then ah=ah+12
430 ah=ah/24
435 gosub720
440 if x=1 then yr=yy:mr=mm:dr=dd:ar=ah
445 for mn=1 to mm-1
450 dc=31
455 if mm=1 then dc=0
460 if mn=2 then dc=28
465 if mn=4 or mn=6 or mn=9 or mn=11 then dc=30
470 md=md+dc
475 next mn
480 if x=1 then m1=md:md=0
485 print:print:next x
490 printtab(14)"working...";
495 y1=yr*365:yd=yy*365:y=(yd+md+dd+ah)-(y1+m1+dr+ar):n=sgn(y):gosub690
505 ty=abs(y):y2=abs(ty)*1000+.5:yt=sgn(ty)*int(y2)/1000
510 ny=yt/365:df=ny-int(ny):nm=df*12:nd=df*365:hf=nd-int(nd):hr=hf*24
515 if hr>23.5 then nd=nd+1:hr=0
520 b=abs(nm)*10+.5:mn=sgn(nm)*int(b)/10:ys=int(ny)
525 if mn=12 then ys=int(ny)+1:mn=0
530 al=abs(l):ld=int(al):lf=al-ld:lh=lf*24:td=int(yt)+ld
535 th=hr+lh
540 if th>23.5 then td=td+1:th=hr+lh-24
545 gosub730
550 print"[157][157][157][157][157][157][157][157][157][157] "
555 printtab(1)"[145][145][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
560 printtab(15)"[145][157]or[157]";"[181][157]";"[181][157]";"[181][157]";"[181][157]";"[181][157]";"[181]"
565 printtab(3)"[145][145][145][145][145][145][145]years[155]"ys
570 printtab(2)"months[155]"mn
575 printtab(22)"[145][145]years[156]"int(ny)
580 printtab(23)"days[156]"int(nd)
585 printtab(22)"hours[156]"int(hr+.5)
590 printtab(18)"leap days[154]"ld;
595 print"hrs[154]"int(lh+.5)
600 printtab(17)"total days[159]"td
605 printtab(16)"total hours[159]"int(th+.5)
610 print:goto30
615 if n=1 then655
620 if mm<3 then630
625 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))thenl=l-1
630 if mr>2 then640
635 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))thenl=l-1
640 ifmm=2anddd=28thenl=l-ah:y=y-ah
645 ifmr=2anddr=28thenl=l+ar:y=y+ar
650 goto715
655 if mm>2 then665
660 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))thenl=l-1
665 if mr<3 then675
670 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))thenl=l-1
675 ifmm=2anddd=28thenl=l+ah:y=y-ah
680 ifmr=2anddr=28thenl=l-ar:y=y+ar
685 goto715
690 for x=yy to yr step1*sgn(yr-yy)
695 if((x/4=int(x/4))and(x/100<>int(x/100)))or(x/400=int(x/400))then l=l+1
700 next
705 if((yy/4=int(yy/4))and(yy/100<>int(yy/100)))or(yy/400=int(yy/400))then615
710 if((yr/4=int(yr/4))and(yr/100<>int(yr/100)))or(yr/400=int(yr/400))then615
715 return
720 pokesd+5,8:pokesd+6,240:pokesd,0:pokesd+1,90:pokesd+4,17:fors=1to100:next
725 goto735
730 pokesd+5,8:pokesd+6,240:pokesd,0:pokesd+1,90:pokesd+4,17:fors=1to500:next
735 pokesd+4,0:pokesd,0:pokesd+1,0:return